package com.cn.jx.manager.po;

import static com.jx.util.CodeUtil.getRandomId;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.cn.jx.common.entity.BaseIdEntity;
import com.jx.enumType.YesNoEnum;

/**
 * <p>Pwd 密码POJO类 对应数据库表名 SYS_PASSWORD
 * <p>实现<{@link Serializable <tt>序列化接口</tt>}
 * <p>实现<{@link BaseIdEntity <tt>BaseIdEntity</tt>}
 *  
 * @author <h1>jiangxu2  2019年11月21日</h1>
 * @version v1.11.20.2019
 * @since 1.0
 * 
 */
@Entity
@Table(name="SYS_PASSWORD")
public class Pwd extends BaseIdEntity {

	private static final long serialVersionUID = -5287303137498839759L;
	
	/** <p>对应userid <p>设置为{@link String String}类型*/
	@Column(name="userId",length=64)
	private String userId;
	
	/** <p>MD5密码 <p>设置为{@link String String}类型*/
	@Column(name="password",length=100)
	private String password;
	
	/** <p>是否最新 1 最新 否则0 <p>设置为{@link Integer Integer}类型*/
	@Column(name="latest")
	private Integer latest;
	
	/** <p>创建时间 <p>设置为{@link Date Date}类型*/
	@Temporal(TemporalType.TIMESTAMP)//设置为时间类型
	@Column(name="create_time")
	private Date createTime;
	
	/**
	 * 初始化创建类
	 * @return
	 */
	public static Pwd getInstance(){
		Pwd m=new Pwd();
		m.setId(getRandomId());
		m.setLatest(YesNoEnum.YES.getCode());
		m.setCreateTime(new Date());
		return m;
	}
	
	/** <p>{@link Date Date}<p>getCreateTime()*/
	public Date getCreateTime() {
		return createTime;
	}
	/** <p>{@link Integer Integer}<p>getLatest()*/
	public Integer getLatest() {
		return latest;
	}
	/** <p>{@link String String}<p>getUserId()*/
	public String getUserId() {
		return userId;
	}
	/** <p>{@link String String}<p>getPassword()*/
	public String getPassword() {
		return password;
	}
	
	/** <p>setCreateTime({@link Date createTime})*/
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	/** <p>setLatest({@link Integer latest})*/
	public void setLatest(Integer latest) {
		this.latest = latest;
	}
	/** <p>setUserId({@link String userId})*/
	public void setUserId(String userId) {
		this.userId = userId;
	}
	/** <p>setPassword({@link String password})*/
	public void setPassword(String password) {
		this.password = password;
	}
}
